home *** CD-ROM | disk | FTP | other *** search
- Path: news-feed.mci.newscorp.com!usenet
- From: pbe@pobox.com
- Newsgroups: comp.lang.c++,comp.lang.pascal.delphi.misc
- Subject: Re: C++ with Zapp vs. Delphi
- Date: 23 Jan 1996 02:47:25 GMT
- Organization: Phoenix Business Enterprises
- Message-ID: <4e1i7t$v29@klein.delphi.com>
- References: <4coar6$d4n@sun4.bham.ac.uk> <4coip7$69s@news1.usa.pipeline.com> <DBk8wg2yqjbB083yn@iaccess.za> <4d7pmb$48c8@tigger.cc.uic.edu> <4dk38h$gdr@merlin.delphi.com> <4dksp1$3d6c@tigger.cc.uic.edu>
- NNTP-Posting-Host: 206.15.161.89
- X-To: olczyk@sunphy1 (Jung Oh)
- X-Mailer: SQUID
- X-Registration: $737961
-
- >How do you write a class SortedList which maintains a list of objects which
- >have a method CompareTo. This lists keeps the objects in sorted order based
- >on CompareTo. You also know that
- >1) It will be used over a long period of time, and there will be many differe
- > classes stored there.
- >2) In some applications, there will be several instances which hold
- > different types.
- >3) Some of the objects stored come from classes which have to inherit from
- > something else.
-
- Create an abstract. Look at TStrings.
-
- >4) Management insists that programmers only get dcu's-- no source. They
- > know that distributing source over the organization causes some of the
- > worst maintenance problems.
-
- This has NOTHING to do with OO or not, this has to do with a FAST
- single pass compiler.
-
- Use an OCX if you need this.
-
- >If you have MI it's easy. Just create a class called SortedObject with
- >a virtual method called CompareTo. Store objects of that type in the list.
-
- Abstract method in Delphi.
-
- >An class that need to get stored can then inherit from SortedObject.
- >Unfortunately you can't use this in Delphi since you know some of the
- >classes already inherit from something else.
-
- You can to do this! Look at TStrings!
-
- >If your language is dynamically typed, it's easy. In the sort routine
- >send the message CompareTo. Unfortunatly Delphi is statically typed.
-
- Just CALL it! (Declare an Abstract!)
-
- Either we are miscommunicating, and one of us does not understand the
- other, or both, but it seems to me you may want to check into Delphi a little
- more.
-
- If I am not understanding you, excuse me. I can read C, but am by no
- means a C expert.
-
- _
- Pennsylvania: The land of Potholes.
-
- +------------------------------------------------------------+
- |* Chad Z. Hower - phoenix@pobox.com |
- |* Consultant - Phoenix Business Enterprises |
- | pbe@pobox.com - http://pobox.com/~pbe |
- |* Principal Analyst Programmer - |
- | SCB Computer Technology Inc - czhower@eastman.com |
- |Physically in Church Hill, TN - Logically Not Sure |
- | **** My Opinions are my own, I don't steal them **** |
- +------------------------------------------------------------+
- >>SQUID - The ultimate database reader, and NO limits. #$737961
- **Special Compile: 1.033B (Beta)
-